<script setup>
import {ElMessageBox} from "element-plus";
import router from "@/router/index.js";
import {useUserLoginStore} from "@/stores/AccountLogin.js";

const logout = () => {
  ElMessageBox.confirm("退出登录", "是否退出登录?", {
    cancelButtonText: '取 消',
    confirmButtonText: '退 出',
    type: 'warning',
  }).then(() => {
    router.push({name: 'home', replace: true});
    useUserLoginStore().reset();
  }).catch(() => {
  })
}
</script>

<template>
  <div class="main">
    <el-menu mode="horizontal" router>
      <el-menu-item index="/enterprise/select">已发布的招聘信息</el-menu-item>
      <el-menu-item index="/enterprise/announce">发布招聘信息</el-menu-item>
      <el-menu-item index="/enterprise/resume">已收简历</el-menu-item>
      <el-menu-item disabled/>
      <el-menu-item disabled/>
      <el-menu-item disabled/>
      <el-button @click="logout" style="color: darkred">退出登录</el-button>
    </el-menu>

    <div class="show">
      <RouterView/>
    </div>
  </div>
</template>

<style scoped>
.main {
  margin: 10px;
  min-width: 1200px;
}

.show {
  margin-top: 10px;
}

.el-menu {
  display: flex;
  justify-content: left;
  align-items: center;
}

</style>